import { add, sub } from './math.js';

const x = 8, y = 18;
console.log(`${x} + ${y} =`, add(x, y)); 
console.log(`${x} - ${y} =`, sub(x, y)); 

document.getElementById('calcBtn').addEventListener('click', async () => {
  // 用户第一次点击时才去下载 math.js
//   const { add, sub } = await import('./math.js');

//   const x = 8, y = 18;
  console.log(`${x} + ${y} =`, add(x, y));
  console.log(`${x} - ${y} =`, sub(x, y));
});